<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.util.ArrayList" %>
<html>
<head>
    <title>购物车</title>
</head>
<body>
<h2>您的购物车</h2>
<%
    ArrayList books = (ArrayList) session.getAttribute("books");
    if (books == null || books.isEmpty()) {
%>
<p>您的购物车是空的。</p>
<%
} else {
%>
<ul>
    <% for (Object book : books) { %>
    <li><%= book %></li>
    <% } %>
</ul>
<%
    }
%>
<a href="sj.jsp">返回添加书籍</a>
</body>
</html>